package com.aaa.dao;

import com.aaa.entity.Emp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;
@Mapper
public interface EmpMapper extends BaseMapper<Emp> {
    @Select("select * from emp where eusername=#{param1} and epassword=#{param2}")
    List<Map<String,Object>> login(String eusername, String epassword);
    @Select("select * from emp where eid=#{eid}")
    List<Emp> select(Integer eid);
    @Select("select e.eid,e.ename,e.eusername,e.epassword,e.phone,e.sex,e.state,r.rolename,e.picture,e.hiredate,e.leavdate from emp e left join role r on e.rid=r.rid")
    List<Emp> select2();
    @Select("select e.eid,e.ename,e.eusername,e.epassword,e.phone,e.sex,e.state,r.rolename,e.picture,e.hiredate,e.leavdate from emp e left join role r on e.rid=r.rid where eusername=#{eusername}")
    List<Emp> select3(String eusername);
}
